package com.lzj.jiangxindaojia.utils;

import android.app.Activity;
import android.content.SharedPreferences;

/**
 * Created by lizj on 2017/12/11.
 */

public class SharePreferenceUtil {

    private static SharedPreferences sp;
    //密码登录
    public static String USERINFO = "userinfo";
    public static String USER_ID = "user_id";
    public static String TOKEN = "token";
    public static String OPEN_INFO = "open_info";
    public static String OPEN_USERID = "open_userid";
    public static String OPEN_ID = "open_id";


    public static String TOKENFILE = "tokenfile";
    //指纹登录
    public static String REGIST_LOGINTOKEN = "regist_logintoken";
    public static String SEC_DATA = "sec_data";
    //指纹支付
    public static String REGIST_PAYTOKEN = "regist_paytoken";


    public static void keepDate(Activity activity, String table, String key, String value) {
        sp = activity.getSharedPreferences(table, 0);
        SharedPreferences.Editor edit = sp.edit();
        edit.putString(key, value);
        edit.commit();
    }

    public static String getData(Activity activity, String table, String key) {
        sp = activity.getSharedPreferences(table, 0);
        return sp.getString(key, "");
    }

}
